﻿using System.Collections.Generic;

namespace Game
{
    public class SceneObjectBattlePropertiesComponent : IComponent
    {
        private Dictionary<int, int> _propertyKey2valueDict = new Dictionary<int, int>();
        
        public SceneObjectBattlePropertiesComponent()
        {
        }
        
        public void Dispose()
        {
        }

        public int GetProperty(int key)
        {
            int value;
            if (_propertyKey2valueDict.TryGetValue(key, out value))
            {
                return value;
            }
            return 0;
        }

        public void SetProperty(int key, int value)
        {
            _propertyKey2valueDict[key] = value;
        }

        public void AddProperty(int key, int delta)
        {
            _propertyKey2valueDict[key] = _propertyKey2valueDict[key] + delta;
        }
    }
}